import axios from '@/libs/api.request';

/**
 * 审批 相关接口
 */

// 审批节点list
export const getApprovalList = (data) => {
  return axios.request({
    url: '/flow/info',
    method: 'post',
    data
  });
};

// 增加审批节点
export const addApprovalNode = data => {
  return axios.request({
    url: '/flow/addnode',
    method: 'POST',
    data: data
  });
};

// 删除审批节点
export const delApprovalNode = data => {
  return axios.request({
    url: '/flow/delnode?nodeId=' + data,
    method: 'POST'
  });
};

// 编辑审批节点
export const editApprovalNode = data => {
  return axios.request({
    url: '/flow/updatenode',
    method: 'POST',
    data: data
  });
};

// 审批节点
export const approvalNodeOpr = data => {
  return axios.request({
    url: '/message/batchOpinions',
    method: 'POST',
    data: data
  });
};

// 打回发起人
export const approvalNodeBackFirst = data => {
  return axios.request({
    url: '/flow/backfirst',
    method: 'POST',
    data: data
  });
};

// 打回上一步
export const approvalNodeBack = data => {
  return axios.request({
    url: '/flow/backstep',
    method: 'POST',
    data: data
  });
};

// 施工检查表审批
export const approvalSgjc = data => {
  return axios.request({
    url: '/pt/report/approve_sgjc',
    method: 'POST',
    data: data
  });
};

// 监理检查表审批
export const approvalJljc = data => {
  return axios.request({
    url: '/pt/report/approve_jljc',
    method: 'POST',
    data: data
  });
};

// 消息管理查看form
export const getFormViewList = data => {
  return axios.request({
    url: '/pt/report/head_by_sp',
    method: 'POST',
    data: data
  });
};

// 消息管理查看tree
export const getViewTree = data => {
  return axios.request({
    url: '/pt/change/tree',
    method: 'POST',
    data: data
  });
};

// 修改检查表的工程名称
export const editDWname = data => {
  return axios.request({
    url: '/pt/editname',
    method: 'POST',
    data: data
  });
};
